#ifndef TI_H
#define TI_H
#include <vector>
#include "common.h"
using namespace std;

typedef struct {
    int length, width, NR_cate;
    int *data;
} cate_map;

typedef struct {
    int length, width;
    float *data;
} cont_map;

typedef struct {
    int max_scale;
    int length, width, NR_cate;
    int *data;
    cate_map *map_cate;            // currently only one grid is used
} train_grid;

typedef struct {
    int length, width;
    float *data;
} train_grid_cont;

typedef struct {
    int max_scale;
    int *length, *width;
    int *hard_data;
    int NR_cate;                // Number of categories
    target_grid_DATA *sample;
} target_grid;

void init_sim_grid(target_grid * grid, int length, int width,
                   int max_scale, int NR_cate, char *sfile);

void init_sim_grid(target_grid * grid, int length, int width,
                   int max_scale, int NR_cate, int NR_sample, int *sample);

int *zoom_in(int *orig_cimg, int orig_xsize, int orig_ysize,
             int scale, int NR_cate);

void build_zoomed_images(int maxscale, train_grid * ti);
void read_image(train_grid * ti, char *file);

#endif                            /* ifndef TI_H */
